﻿<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>  
<head>
   <!-- 包含公共的JSP代码片段 -->
<title>无线点餐平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="${pageContext.request.contextPath }/backstage/detail/style/js/jquery.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/backstage/detail/style/js/page_common.js"></script>
<link href="${pageContext.request.contextPath }/backstage/detail/style/css/common_style_blue.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/backstage/detail/style/css/index_1.css" />
</head>
<script type="text/javascript">
/** 
* 从 file 域获取 本地图片 url 
*/ 
	function getFileUrl(sourceId) { 
		var url; 
		if (navigator.userAgent.indexOf("MSIE")>=1) { // IE 
			url = document.getElementById(sourceId).value; 
		} 
		else if(navigator.userAgent.indexOf("Firefox")>0) { // Firefox 
			url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0)); 
		}else if(navigator.userAgent.indexOf("Chrome")>0) { // Chrome 
			url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0)); 
		} 
		return url; 
	} 

/** 
* 将本地图片 显示到浏览器上 
*/ 
	function preImg(sourceId, targetId) { 
		var url = getFileUrl(sourceId); 
		var imgPre = document.getElementById(targetId); 
		imgPre.src = url; 
	} 
</script>     
<body>
<!-- 页面标题 -->
<div id="TitleArea">
	<div id="TitleArea_Head"></div>
	<div id="TitleArea_Title">
		<div id="TitleArea_Title_Content">		
			<img border="0" width="13" height="13" src="style/images/title_arrow.gif"/> 更新新菜品
		</div>
    </div>
	<div id="TitleArea_End"></div>
</div>

<!-- 主内容区域（数据列表或表单显示） -->
<div id="MainArea">
	<!-- 表单内容 -->
	<form action="/everyOrder/food/addFood.do" method="post" enctype="multipart/form-data">
		<!-- 本段标题（分段标题） -->
		<div class="ItemBlock_Title">
        	<img width="4" height="7" border="0" src="style/images/item_point.gif"> 菜品信息&nbsp;
        </div>
		<!-- 本段表单字段 -->
        <div class="ItemBlockBorder">
            <div class="ItemBlock">
				<div class="ItemBlock2">
					<table cellpadding="0" cellspacing="0" class="mainForm">
                    <tr>
							<td width="80px">菜系</td>
							<td>
							
	                            <select name="foodtype.id" style="width:80px">
	                            	<option value="">--请选择菜系--</option>
	                           	 	<c:forEach items="${foodtype}" var="foodtype">	                           
				   						<option value="${foodtype.id}">${foodtype.typename }</option>
	                           		</c:forEach>
	                            </select>
                            
                             <input type="hidden" name="id" value="1" /></td>
						</tr>
						<tr>
							<td width="80px">菜名</td>
							<td><input type="text" name="foodname" class="InputStyle" value="${food.foodname}"/> *</td>
						</tr>
						<tr>
							<td>价格</td>
							<td><input type="text" name="price" class="InputStyle" value="${food.price}"/> *</td>
						</tr>
                        <tr>
							<td>会员价格</td>
							<td><input type="text" name="mprice" class="InputStyle" value="${food.mprice}"/> *</td>
						</tr>
						<tr>
							<td>简介</td>
							<td><textarea name="remark" class="TextareaStyle">粤菜白灼虾，大件！</textarea></td>
						</tr>
						<tr>
							<td width="80px">菜品图片</td>
							<td>	
									<!-- <img style='max-width:68px;width:68px;width:expression(width>68?"68px":width "px");max-width: 68px;' 
									src="style/images/baizhuoxia.jpg"> -->
									<%-- <div><img id="imghead" width=100 height=100 border=0 src='${pageContext.request.contextPath }/images/defaul.jpg'></div> --%>
									<img id="imgPre" src="" width="68px" height="68px" style="display: block;" /> 
									<input type="hidden" name="image" value="baizhuoxia.jpg">
									<input type="file" name="file" id="imgOne" onchange="preImg(this.id,'imgPre');"/> *
							</td>
						</tr>
					</table>
				</div>
            </div>
        </div>
		
		<!-- 表单操作 -->
		<div id="InputDetailBar">		
			 <input type="submit" value="修改" class="FunctionButtonInput">
            <a href="javascript:history.go(-1);" class="FunctionButton">返回</a>
        </div>       
	</form>
</div>
</body>
</html>